<form method="post" enctype="multipart/form-data" class="form-x one-form form-auto" id="form" action="{:U('/Article/addArticle',array('id'=>$article['id']))}">
	 <div class="panel one-box  active">
        <div class="panel-head">
            <strong>文章发布</strong>
        </div>
        <div class="panel-body">	
			<div class="form-group">
                <div class="label">
                    <label>所属分类</label>
                </div>
                <div class="field">
                    <select class="input" name="cid">
						<!--
						<if condition='ACTION_NAME eq "article"'>	
						<option value="">===请选择分类===</option>
						<else/>
						<option value="{$article.cid}">{$article.classify}</option>
						</if>
						-->
						<option value="">===请选择分类===</option>
						<foreach name='class' item='c'>
							
                            <if condition="$c.id eq $article['cid']">   
                                <option selected="selected" value="{$c.id}">{$c.name}</option>
                            <else/>
                                <option value="{$c.id}">{$c.name}</option>
                            </if>
						</foreach>
					</select>
                </div>
            </div>
			<div class="form-group">
                <div class="label">
                    <label>作者</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="editor" size="60" value="{$article.editor}">
                </div>
            </div>
			<div class="form-group">
                <div class="label">
                    <label>标题</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="title" size="60" value="{$article.title}">
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>封面</label>
                </div>
                <div class="field">
                    <input type="text" class="input" id="image" name="image" readonly="readonly" size="38" value="{$article.image}">
                    <a class="button bg-blue button-small  js-img-upload" data="image" id="image_upload" preview="image_preview""><span class="icon-upload"> 上传</span></a>
                    <a class="button bg-blue button-small icon-picture-o" id="image_preview" href="javascript:;" > 预览</a>
                    <div class="input-note">封面图片尺寸370x294</div>
                </div>
            </div>
			<!--<div class="form-group">
                <div class="label">
                    <label>摘要</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="summary" size="60" value="{$article.summary}">
                </div>
            </div>-->
			<div class="form-group">
                <div class="label">
                    <label>内容</label>
                </div>
                <div class="field">
                    <textarea type="input js-editor" class="input" name="content" style="width: 100%; height: 200px;" >{$article.content}</textarea>
                </div>
            </div>
			<div class="form-group">
                <div class="label">
                    <label>点击次数</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="click" size="60" value="<?php echo $article['click']?$article['click']:0;?>">
                </div>
            </div>
			<!--<div class="form-group">
                <div class="label">
                    <label>重要通告</label>
                </div>
                <div class="field">
                    <div class="button-group radio">
                        <if condition="$article.important == 1">
                            <label class="button active"><input name="target" value="1" checked="checked" type="radio">
                                <span class="icon icon-check"></span> 是</label>
                            <label class="button"><input name="important" value="0" type="radio">
                                <span class="icon icon-times"></span> 否</label>
                            <else/>
                            <label class="button"><input name="important" value="1" checked="checked" type="radio">
                                <span class="icon icon-check"></span> 是</label>
                            <label class="button active"><input name="important" value="0" type="radio">
                                <span class="icon icon-times"></span> 否</label>
                        </if>
                    </div>
                    <div class="input-note">勾选是否重要通告</div>
                </div>

            </div>-->

        </div>
        <div class="panel-foot">
            <div class="form-button">
                <div id="tips"></div>
				<button class="button bg-main" id="ajaxForm" type='submit'>保存</button>
				<if condition='ACTION_NAME eq "article"'>	
                <button class="button bg" type="reset">重置</button>
				</if>
            </div>
        </div>
    </div>
</form>

<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="content"]', {
            cssPath : '__PUBLIC__/keditor/plugins/code/prettify.css',
            uploadJson : '__PUBLIC__/keditor/php/upload_json.php',
            fileManagerJson : '__PUBLIC__/keditor/php/file_manager_json.php',
            allowFileManager : true
        });
        prettyPrint();
    });
</script>

<script type="text/javascript" src="__PUBLIC__/webuploader/FileUpload.js"></script>
